/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entity;

import java.io.Serializable;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

/**
 *
 * @author Declan
 */
@Entity
@DiscriminatorValue("CONTRACT")
public class Contract extends Product implements Serializable {

    @ManyToOne(optional=false)
    @JoinColumn(name="NETWORK_ID")
    public Network getNetwork()     { return network; }

    protected Network network;
    protected String contractName;

    @Override
    public String getName() {
        return network.getName() + " " + contractName;
    }

    public Contract() {}
    public Contract(Network network, String contractName)
    {
        this.network = network;
        this.contractName = contractName;
    }


}
